package com.wealth.cart.service;
 
import iaas.service.IBaseService;

import java.util.List;
import java.util.Map;

import com.wealth.cart.entity.Cart;
import com.wealth.cart.entity.CartGoodsInfo;
import com.wealth.commodity.entity.Goods;

public interface ICartService extends IBaseService<Cart> {

	public void addCart(long memberid,int amount,Goods goods,Long marketId)throws Exception;
	
	//保存或修改购物车
	public Map<String, Object> saveOrUpdate(Long goodsId,int amount,Long memberid,Long marketId) throws Exception;
	
	//选中购物车里的商品
	public Map<String, Object>  checkCartItem(Long goodsId,Integer status,Long memberid,Long marketId,int amount) throws Exception;
	
	//选中购物车
	public Map<String, Object>  checkCart(Integer status,Long memberid,Long marketId) throws Exception;
	
	
	

	//删除购物车
	public void delCart(Cart cart) throws Exception;
	//查询购物车
	public Cart findCartByMemberIdAndMarketId(Long memberId,Long marketId);
	
	public Cart findCartByMemberId(long id)throws Exception;
	
	/**
	 * 查询我的购物车
	 * @param memberId 会员ID
	 * @param marketId 市场ID 
	 * @return
	 * @throws Exception
	 */
	public List<CartGoodsInfo> getCartGoodsByMemberId(long memberId,Long marketId) throws Exception;
	//会员+市场
	public Cart findCartByMemeberIdAndMarketId(Long memberId,Long marketId);
	
	//删除购物车
	public Map<String, Object> delCartItem(Long goodsId,Long memberId,Long marketId);
	
	//计算购物车总金额
	public double getTotal(Cart cart);
	
	/**
	 * 查询我的购物车中选中商品
	 * @param memberId 会员ID
	 * @param marketId 市场ID 
	 * @return
	 * @throws Exception
	 */
	public List<CartGoodsInfo> getCheckedCar(long memberId,Long marketId) throws Exception;
 }
